import React from 'react';
import { history } from 'umi'
import { Alert } from 'antd';
import { Tip } from '../../components';

export default function PrepareAlert({ message, renderButton }) {
    const jump = React.useCallback(id => {
        history.push({
            pathname: '/office/personnelManagement/onboardAndLeave/informal/process/detail',
            query: { id },
            state: { tabRoute: true, tabRefresh: true }
        });
    }, []);
    return <Alert message={<Tip action={renderButton(jump)} tip={message} />} type="info" />;
}
